﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GraphConfigTool
{
    public class LineHeaterStrip
    {
        public int value = 150;//基础值
        public string unit = "W";//单位
        public int initLength = 50;//初始长度
        public int length;//基础长度
        public int lineWidth = 8;//宽度
        public Color nameColor;
        public Point nameLocation;
        public int type;
        public bool configAddressFlag = false;//该加热条是否配置地址标记
        public int dialNumber;//拨码号
        public int location;//引线位置
        public bool isVertical = false;//是否竖直 默认水平

        public Color penColor;
        public Point point1 { get; set; }
        public Point point2 { get; set; }
        public Font font = new Font("宋体", 10);


        public int Value
        {
            get { return value; }
            set
            {
                if (this.value != value)
                {
                    this.value = value;

                    length = initLength + value / 20;
                    point2 = calculatePoint(point1);
                }
            }
        }

        public LineHeaterStrip()
        {
            nameColor = Color.Black;
            //pen = new Pen(Color.FromArgb(28, 134, 238), width);
            penColor = Color.FromArgb(205, 0, 205);
            //length = length + value / 10;//比例
            length = initLength + value / 20;
        }
        //计算第二个点的值
        public Point calculatePoint(Point point)
        {
            return new Point(point.X + length, point.Y);
        }
        public LineHeaterStrip(Color color, int width)
        {

        }
    }
}
